<template>
  <page-header-wrapper class="indexBox">
    <a-card :bordered="false">
      <div class="table-page-search-wrapper">
        <a-form layout="inline">
          <a-row :gutter="48">
            <a-col :md="6" :sm="24">
              <a-form-item label="空间列表选择">
                <a-select
                  show-search
                  placeholder="请选择空间列表"
                  option-filter-prop="children"
                  style="width: 200px"
                  @change="handleChange"
                >
                  <a-select-option value="0">全部</a-select-option>
                  <a-select-option value="1">采购</a-select-option>
                  <a-select-option value="2">商务</a-select-option>
                  <a-select-option value="3">行政</a-select-option>
                  <a-select-option value="4">生产</a-select-option>
                  <a-select-option value="5">财务</a-select-option>
                </a-select>
              </a-form-item>
            </a-col>

            <a-col :md="4" :sm="24">
              <a-form-item label>
                <a-input-search v-model="queryParam.memberId" placeholder="请输入角色名称/代码" />
              </a-form-item>
            </a-col>

            <a-col :md="5" :sm="24" style="padding-left:0">
              <span>
                <a-button type="primary" icon="search" @click="loadDataRefresh()">查询</a-button>
              </span>
            </a-col>

            <a-col :md="(!advanced && 9) || 24" :sm="24" style="text-align: right;">
              <span>
                <a-button type="primary" icon="plus" @click="submitBtn()">提交</a-button>
              </span>
            </a-col>
          </a-row>
        </a-form>
      </div>

      <a-row>
        <a-col :span="24" class="justCont">
          <a-checkbox-group @change="onChange">
            <a-row :gutter="16">
              <a-col :span="6" v-for="(item,index) in dataFile" :key="index">
                <div class="gutter-box">
                  <a-checkbox
                    :value="item.value"
                    :style="{position: 'absolute', top:'10px',right: '20px' }"
                    v-model="dataFileValue"
                  ></a-checkbox>
                  <div>
                    <img src="../../assets/p_001.png" alt />
                  </div>

                  <div>
                    <div class="gutter-a">
                      <em>{{item.a}}</em>
                    </div>
                    <div class="gutter-b">
                      <em>{{item.b}}</em>
                    </div>
                    <div class="gutter-c">
                      <a-col :span="8">
                        <em>{{item.c}}</em>
                      </a-col>
                      <a-col :span="16" style="text-align: right;">
                        <a-icon type="snippets" />
                        <em style="padding-right:8px" @click="openAlarmWindow = true">预览</em>
                      </a-col>
                    </div>
                  </div>
                </div>
              </a-col>
            </a-row>
          </a-checkbox-group>
        </a-col>
      </a-row>

      <!-- 弹窗 -->
      <div class="alarmWindowBox flex-center" v-if="openAlarmWindow">
        <div class="alarmBox" @click="openAlarmWindow = false">
          <div class="alarmTitle flex-align-center">
            <span class="closeBox flex-center">
              <a-icon type="close" style="color: #ff0000" />
            </span>
          </div>
          <div class="alarmBigImg">
            <img src="../../assets/p_001.png" alt />
          </div>
        </div>
      </div>
    </a-card>
  </page-header-wrapper>
</template>

<script>
import { putAction, postAction, getAction } from '@/api/manage'
export default {
  name: 'TableList',
  components: {},
  data() {
    return {
      // 高级搜索 展开/关闭
      advanced: false,
      isShowImg: false,
      openAlarmWindow: false,
      dataFileValue: '',
      checkedKeys: [],
      // 查询参数
      queryParam: {},
      seqList: [
        { id: 1, seqName: '默认排' },
        { id: 2, seqName: '按时间排序' },
      ],
      dataFile: [
        {
          img: '../../assets/p_001.png',
          a: '角色面板X1',
          b: '最好的决策是数据通过不断积累和算法来进行推论的',
          c: '5 小时前',
          value: 'a',
        },
        {
          img: '../../assets/background.png',
          a: '角色面板A',
          b: '最好的决策是数据通过不断积累和算法来进行推论的',
          c: '5 小时前',
          value: 'b',
        },
        {
          img: '../../assets/p_001.png',
          a: '角色面板B',
          b: '最好的决策是数据通过不断积累和算法来进行推论的',
          c: '5 小时前',
          value: 'g',
        },
        {
          img: '../../assets/background.png',
          a: '角色面板C',
          b: '最好的决策是数据通过不断积累和算法来进行推论的',
          c: '5 小时前',
          value: 'c',
        },
        {
          img: '../../assets/background.png',
          a: '角色面板D',
          b: '最好的决策是数据通过不断积累和算法来进行推论的',
          c: '5 小时前',
          value: 'd',
        },
        {
          img: '../../assets/background.png',
          a: '角色面板B',
          b: '最好的决策是数据通过不断积累和算法来进行推论的',
          c: '5 小时前',
          value: 'e',
        },
        {
          img: '../../assets/background.png',
          a: '角色面板C',
          b: '最好的决策是数据通过不断积累和算法来进行推论的',
          c: '5 小时前',
          value: 'f',
        },
        {
          img: '../../assets/background.png',
          a: '角色面板D',
          b: '最好的决策是数据通过不断积累和算法来进行推论的',
          c: '5 小时前',
          value: 'h',
        },
      ],
    }
  },

  methods: {
    loadDataRefresh() {},
    onChange(checkedValues) {
      this.checkedKeys = checkedValues
    },
    handleChange(value) {
      console.log(`selected ${value}`)
    },

    submitBtn() {
      console.log(this.checkedKeys)
      console.log(typeof this.checkedKeys)
    },
  },
}
</script>
<style lang="less" >
.justTop {
  margin: 20px 20px 0 0;
  .justCur {
    span {
      padding: 0 20px;
      cursor: pointer;
    }
    .styleName {
      text-align: center;
      height: 38px;
      border-radius: 5px;
      line-height: 38px;
      color: #fff;
      display: inline-block;
      width: 110px;
      cursor: pointer;
      background-color: rgba(153, 153, 153, 1);
    }
  }
}
.justCont {
  .gutter-box {
    min-height: 400px;
    border: 1px solid rgba(228, 228, 228, 1);
    display: flex;
    flex-direction: column;
    padding: 0 !important;
    cursor: pointer;
    img {
      width: 100%;
      height: 213px;
    }
    em {
      font-style: normal;
      margin: 10px 0 0 10px;
      font-size: 16px;
      display: inline-block;
    }
    .gutter-a {
      height: 55px;
      span {
        font-size: 30px;
        font-weight: 600;
        font-family: '微软雅黑';
      }
    }
    .gutter-b {
      height: 90px;
    }
    .gutter-c {
      height: 45px;
    }
  }
  .ant-col-6 {
    margin-top: 20px;
  }
}

// 弹窗
.alarmWindowBox {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.6);
  z-index: 9999;
  opacity: 0.9;
  .alarmBox {
    position: absolute;
    overflow: hidden;
    left: 50%;
    top: 50%;
    margin-top: -300px;
    margin-left: -540px;
    .alarmTitle {
      height: 40px;
      justify-content: space-between;
      color: white;
      font-size: 18px;
      .alarmTitleName {
        text-indent: 20px;
        line-height: 40px;
        height: 100%;
        width: 250px;
        background: linear-gradient(-135deg, transparent 30px, red 0) top right;
      }
      .closeBox {
        height: 24px;
        width: 24px;
        border: red 1px solid;
      }
    }
    .alarmBigImg {
      width: 1080px;
      height: 600px;
      img {
        width: 1080px;
        height: 600px;
      }
    }
  }
}
</style>
